package com.example.controller;

import com.example.common.Page;
import com.example.common.PageQueryParam;
import com.example.entity.TListAndSongEntity;
import com.example.entity.TSongEntity;
import com.example.service.TListAndSongService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/tlistandsong")
public class TListAndSongController {
    @Autowired
    TListAndSongService tListAndSongService;

    @RequestMapping(value = "/create")
    public Integer create(@RequestBody() TListAndSongEntity tListAndSongEntity){
        Integer integer = tListAndSongService.create(tListAndSongEntity);
        return integer;
    }

    @RequestMapping(value = "/query")
    public Page<TSongEntity> query(@RequestBody() PageQueryParam<TListAndSongEntity> pageQueryParam){
        Page<TSongEntity> query = tListAndSongService.query(pageQueryParam);
        return query;
    }

    @RequestMapping(value = "/delete")
    public Integer delete(@RequestBody() TListAndSongEntity tListAndSongEntity){
        Integer integer = tListAndSongService.delete(tListAndSongEntity);
        return integer;
    }
}
